package com.dbq.fast.fcm;

import com.dbq.fast.util.SpUtil;
import com.google.firebase.iid.FirebaseInstanceId;
import com.google.firebase.iid.FirebaseInstanceIdService;
import com.yiba.vpn.utils.logger.LogUtil;



/**
 * Created by Widsom Zhang on 2017/10/31.
 */

public class MyFirebaseInstanceIdService extends FirebaseInstanceIdService {

    public static final String FIREBASE_MESSAGE_TOKEN = "firebase_message_token";

    @Override
    public void onTokenRefresh() {
        super.onTokenRefresh();
        String token = FirebaseInstanceId.getInstance().getToken();
        LogUtil.e("firebase message --> onTokenRefresh--> token:" + token);
        SpUtil.setString(FIREBASE_MESSAGE_TOKEN, token);
        UploadTokenUtil.sendFirebaseTokenToServer();
    }
}
